import React, { useState, useEffect } from "react";

const aa = 10;
function App() {
  const [data, setData] = useState("initialState");
  useEffect(() => {
    const p = new Promise((resolve) => {
      setTimeout(
        () => {
          resolve("promise执行了");
        },

        3000,
      );
    }).then((res) => {
      console.log("then:", res);
    });
  }, []);
  return <div>{data}</div>;
}

export default App;
